package cn.edu.scujcc.staffdiary.ui.clock;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class NetworkFactory {
    public static final String SERVER_URL = "http://8.140.118.103:8080";
    private static Retrofit retrofit;
    private static ClockApi clockApi;

    static {
        retrofit = new Retrofit.Builder()
                .baseUrl(SERVER_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public static ClockApi getClockApi() {
        if (null == clockApi) {
            clockApi = retrofit.create(ClockApi.class);
        }
        return clockApi;
    }
}
